package com.gxar.quick.ar.server.base.model;

import com.gxar.common.entity.ResultCode;

/**
 * ResultCodeEnum
 *
 * @author Linsy
 * @version 1.0
 * @created 2023/6/20 11:25 AM
 */
public enum ResultCodeEnum implements ResultCode {

    /**
     * 71*** 作品相关
     * 72*** 用户相关
     * 73*** 坑位相关
     * 74*** 订单相关
     * 75*** 交易相关
     * 76*** 广场相关
     * 77*** 套餐相关
     * 78*** 分享相关
     * 79*** 第三方相关
     * 711** 素材相关
     * 81*** AR协议相关
     */
    WORK_DRAFTS_NOT_EXIST(71001, "作品草稿不存在"),
    WORK_NOT_EXIST(71002, "作品不存在"),
    WORK_TEMPLATE_NOT_EXIST(71003, "作品模板不存在"),
    WORK_ALREADY_FAVORITES(71004, "作品已经收藏，不能重复收藏"),
    WORK_DRAFT_ID_MISMATCH(71005, "作品ID与原草稿作品ID不匹配"),
    WORK_PUBLISHED(71006, "作品已发布，不能重复发布"),
    NO_SIZE_AVAILABLE(71007, "作品容量已上限，请升级套餐"),
    SHARE_OWN_WORKS(71008, "只支持分享自己的作品"),
    WORK_SHARE_INFO_ERROR(71009, "暂无该作品的分享信息"),
    WORK_SHARE_INFO_INVALID(71010, "该作品已删除，无法查看"),
    WORK_IDS_NOT_NULL(71011, "请选择要删除的作品"),
    DELETE_WORK_NOT_SELF(71012, "删除的作品不是自己的作品，请重新选择"),
    IMPRESSIONS_LIMIT(71013, "该作品浏览次数已达上限，无法浏览"),
    WORK_DRAFTS_LIMIT(71014, "草稿已上限，无法继续创建"),
    WORK_OFFLINE_NOT_PUBLISH(71015, "作品已下线无法发布"),
    FILE_SIZE_ERROR(71016, "作品容量校验异常，请尝试重新上传作品内容"),
    WORK_PREVIEW_FAIL(71017, "预览失败，请返回重新预览"),
    WORK_DELETED_FAIL(71018, "作品删除异常"),
    WORK_OFFLINE_NOT_SHARE(71019, "作品已下线无法分享"),
    WORK_IDENTIFY_NOT_NULL(71020, "请上传识别图"),
    WORK_IDENTIFY_NOT_CHANGE(71021, "暂不支持更换识别图"),
    WORK_SHARE_INFO_OFFLINE(71022, "该作品已下线，无法查看"),
    DELETE_WORK_NOT_EXIST(71023, "请正确选择要删除的作品"),
    NO_IDENTIFY_SIZE_AVAILABLE(71024, "识别图容量已上限，请升级套餐"),
    NO_VIDEO_SIZE_AVAILABLE(71025, "视频容量已上限，请升级套餐"),
    NO_3D_MODEL_SIZE_AVAILABLE(71026, "3D模型容量已上限，请升级套餐"),
    WORKS_IMPRESSIONS_LIMIT(71027, "作品识别失败，作品识别次数已上限"),
    WORK_TRANSFER_METHOD_ERROR(71028, "作品转移方式错误，请选择正确的作品转移方式"),
    TRANSFER_WORK_IDS_NOT_NULL(71029, "请选择作品"),
    NOT_WORKS_CAN_RECEIVE(71030, "对不起，没有可领取的作品，请确认领取码的有效性"),
    NOT_PERMISSIONS_WORKS_RECEIVE(71031, "对不起，您没有权限领取作品"),
    WORK_IDENTIFY_UPLOAD_ERROR(71032, "作品识别图上传失败"),
    WORK_IDENTIFY_DEL_ERROR(71033, "作品识别图删除失败"),
    WORK_IDENTIFY_LIKE_ERROR(71034, "作品识别图过于相似,请更换识别图"),
    ORI_SHARE_IDENTIFY_DEL_ERROR(71035, "原分享识别图删除失败"),
    EXCHANGE_CODE_INVALID(71036, "无效的兑换码"),
    EXCHANGE_CODE_EXCHANGED(71037, "兑换码已兑换"),
    EXCHANGE_WORKS_IS_NULL(71038, "可用兑换品为空"),
    TRANSFER_USER_NOT_NULL(71039,  "赠送的用户不能为空"),
    USER_EXCHANGE_NOT_FOUND(71040, "兑换品不存在"),
    USER_EXCHANGE_TEMPLATE_NOT_FOUND(71041, "兑换品模板不存在"),
    OPERATE_EXCHANGE_ITEM_NOT_PERMISSIONS(71042, "该兑换品不属于你，你没有权限修改"),
    EXCHANGE_TEMPLATE_UN_SHELVES_UNAVAILABLE(71043, "选择的模板未上架或者不可用"),
    EXCHANGE_ITEM_PRICE_ERROR(71044, "兑换品的价格必须大于0.01"),
    NOT_SHELVES_PERMISSIONS(71045, "您没有该作品的上/下架权限"),
    EXCHANGE_ITEM_NOT_TRANSFER_MINE(71046, "兑换品不能转赠给自己"),
    EXCHANGE_ITEM_NOT_SEND_MINE(71045, "兑换品不能赠送给自己"),
    DUPLICATE_EXCHANGE_CODE_RETRY(71046, "兑换码生成重复，请重试"),
    EXCHANGE_CODE_CREATE_FAIL(71047, "兑换码创建失败"),
    EXCHANGE_CODE_WRITTEN_OFF(71048, "该奖品已核销，无法重复核销"),
    EXCHANGE_WRITTEN_OFF_IS_NULL(71049, "没有可核销的作品内容～"),
    EXCHANGE_ACTIVITY_DISABLE(71050, "活动兑换已结束"),
    EXCHANGE_RECEIVED(71051, "您已获得该兑换品的AR礼品，无法再次参与抽奖"),

    /**
     * 72*** 用户相关
     */
    USER_NOT_EXIST(72001, "用户未授权"),
    USER_CONFIG_NOT_EXIST(72002, "用户配置信息出错啦"),
    USER_RIGHT_PARAM_ITEM_ERROR(72003, "查询用户权益计费项参数有误"),
    // 为了兼容用户未登录的code，修改msg提示
    USER_CHECK_FAIL(1010, "校验用户失败，请确认后重试"),
    NO_PERMISSION_CHANGE_CONFIG(72004, "对不起，您当前没有权限变更账号配置"),
    USER_NOT_NULL(72005, "要变更的用户不能为空"),
    CHANGE_METHOD_ERROR(72006, "请选择正确的变更方式"),
    END_TIME_BERORE_START_TIME(72007, "结束时间不能在开始时间之前"),
    USER_IDS_NOT_EMPTY(72008, "请选择用户"),
    USER_EXISTS(72009, "用户已创建，不可重复创建"),
    MENU_USER_ERROR(72010, "查询菜单用户失败"),
    ROLE_USER_DELETE_ERROR(72011, "角色用户删除失败"),
    USER_CHECK_BY_MOBILE_ERROR(72012, "手机号码验证失败"),
    EXCEL_ERROR(72013, "Excel解析错误"),
    USER_EXCHANGE_ADD_LIMIT(72014, "单次最多可配置10个兑换品"),
    USER_EXCHANGE_CODE_NOT_NULL(72015, "请选择发放的兑换品"),

    /**
     * 73*** 坑位相关
     */
    SLOT_NOT_EXIST(73001, "坑位不存在"),
    NO_SLOT_AVAILABLE(73002, "您的作品已达上限"),
    TARGET_USER_SLOT_LIMIT(73003, "目标用户坑位已达上限"),

    /**
     * 74*** 订单相关
     */
    ORDER_NOT_EXIST(74001, "订单不存在"),
    ORDER_METHOD_NOT_MATCH(74002, "暂不支持更换套餐，请到期后续费"),
    ORDER_RENEW_NOT_MATCH(74003, "还未购买套餐，请购买后续费"),

    /**
     * 75*** 交易相关
     */
    TRANSACTION_NOT_EXIST(75001, "交易单不存在"),

    /**
     * 76*** 广场相关
     */
    PLAZA_NOT_EXIST(76001, "广场作品不存在"),
    PLAZA_EXISTS(76002, "广场作品已存在"),
    PLAZA_NO_UPDATE_PERMISSION(76003, "你没有该作品的更新权限，请联系发布人更新"),
    PLAZA_NO_DELETE_PERMISSION(76004, "你没有该作品的删除权限，近允许发布人删除"),

    /**
     * 77*** 套餐相关
     */
    COMBO_NOT_EXIST(77001, "套餐不存在"),

    /**
     * 78*** 分享相关
     */
    SHARE_FAILED(78001, "分享失败"),

    /**
     * 第三方相关
     */
    TRANSLATE_FAIL(79001, "翻译失败"),
    WECHAT_NO_RESPONSE(79002, "微信接口未响应"),
    WECHAT_EXCEPTION(79003, "微信接口异常"),
    WECHAT_GET_TOKEN_FAIL(79004, "微信请求请求获取Token失败"),
    QR_C0DE_FAIL(79005, "微信二维码获取失败"),
    FILE_UPLOAD_FAIL(79006, "文件上传失败"),
    QI_MEN_LOTTERY_FAIL(79007, "奇门抽奖失败"),
    /**
     * 素材相关
     */
    MATERIAL_TYPE_ERROR(71101, "素材类型错误"),
    MATERIAL_INNER_HEIGHT_NOT_NULL(71102, "素材内部高度不能为空"),
    MATERIAL_INNER_WIDTH_NOT_NULL(71103, "素材内部宽度不能为空"),
    MATERIAL_INNER_X_NOT_NULL(71104, "X轴起点坐标不能为空"),
    MATERIAL_INNER_Y_NOT_NULL(71105, "Y轴起点坐标不能为空"),
    MATERIAL_NAME_USED(71106, "素材名称已被占用"),
    MATERIAL_NOT_EXIST(71107, "素材不存在"),
    IMAGE_SPLIT_FAIL(71108, "图片分割失败"),

    /**
     * 81*** AR协议相关
     */
    CONVERT_PROTOCOL_PARAM_ERROR(81001, "协议转化参数错误"),
    CONVERT_EDITOR_PROTOCOL_FAILED(81101, "编辑器协议转化失败"),
    CONVERT_COMMON_PROTOCOL_FAILED(81201, "通用协议转化失败"),
    CONVERT_CLIENT_PROTOCOL_FAILED(81301, "客户端协议转化失败"),
    CLIENT_UPDATE_POSITION_FAILED(81401, "客户端修改作品信息异常"),
    AR_SHOW_CONTENTS_IS_EMPTY(81402, "配置展示物列表为空"),
    AR_UPDATE_TARGET_CONTENT_ITEM_NOT_FOUND(81403, "未找到要修改坐标的展示物"),
    AR_UPDATE_POSITION_IS_EMPTY(81404, "更新坐标为空"),
    AR_UPDATE_POSITION_FORMAT_ERROR(81405, "更新坐标格式错误"),

    ;

    private final Integer code;
    private final String msg;

    ResultCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getRet() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
